package cn.tl.pet.controller;

import cn.tl.org.utils.AjaxResult;
import cn.tl.pet.domain.SearchMasterMsg;
import cn.tl.pet.query.SearchMasterMsgQuery;
import cn.tl.pet.service.ISearchMasterMsgService;
import cn.tl.utils.LoginContext;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import javax.servlet.http.HttpServletRequest;
import java.util.List;

@RestController
@RequestMapping("/searchMasterMsg")
public class SearchMasterMsgController {
    @Autowired
    private ISearchMasterMsgService seachMasterMsgService;


    @GetMapping
    public List<SearchMasterMsg> getAll(){
        return seachMasterMsgService.findAll();
    }
    @PostMapping("/publish")
    public AjaxResult  publish(@RequestBody SearchMasterMsg masterMsg, HttpServletRequest request){
        seachMasterMsgService.publish(masterMsg,request);
        return AjaxResult.me();
    }



}
